package com.wlz.creational.factory.simpleFactory;

import com.wlz.creational.factory.simpleFactory.impl.BlackHuman;
import com.wlz.creational.factory.simpleFactory.impl.WhiteHuman;
import com.wlz.creational.factory.simpleFactory.impl.YellowHuman;

public class HumanFactory extends AbstractHumanFactory {
    @Override
    public <T extends Human> T createHuman(String humanType) {
        if (humanType.equals("yellow")){
            return (T) new YellowHuman();
        }else if(humanType.equals("black")){
            return (T) new BlackHuman();
        }else if(humanType.equals("white")){
            return (T) new WhiteHuman();
        }
        return null;
    }
}
